// pages/logen2/login2.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    userInfo: null,
  },
  Login(e) {
    let that = this
    wx.getUserProfile({
      desc: 'desc',
      success(res) {
        wx.login({
          success(res1) {
            //  console.log(res.userInfo)
            wx.request({
              url: 'http://dil.aynakedu.com/api/Loginpages',
              data: {
                code: res1.code,
                userInfo: res.userInfo
              },
              //第三步
              method: "POST",
              success(res2) {
                console.log(res2);
                that.setData({
                  userInfo: res2.data.userInfo,
                });
              }
            });
          }
        });
      }
    });
  }



})